﻿@inherits BaseInputInline<bool>

@namespace FluentCMS.Web.UI.Components

@if (Visible)
{
    <FormField Cols="Cols" Dense="@Dense" Id="@Id" Hint="@Hint" Label="@Label" LabelFragment="@LabelFragment" Required="@Required">
        <div class="@this.GetClasses()">
            <input @attributes="AdditionalAttributes"
                   checked="@BindConverter.FormatValue(CurrentValue)"
                   class="@this.ClassName("FormCheckboxInput")"
                   disabled="@Disabled"
                   id="@Id"
                   name="@NameAttributeValue"
                   type="checkbox"
                   value="@bool.TrueString"
                   @onchange="EventCallback.Factory.CreateBinder<bool>(this, __value => CurrentValue = __value, CurrentValue)" />
            @if (!string.IsNullOrEmpty(Text))
            {
                <label for="@Id" class="@this.ClassName("FormCheckboxLabel")">
                    @Text
                </label>
            }
        </div>
    </FormField>
}
